<template>
    <div class="box">
        <div class="title">{{$t('ledger')}} | {{$t('detls')}}</div>
        <el-card class="cardBox">
            <el-table border style="width: 100%" row-key="funcId" :data="accBillTab" id="out-table">
                <el-table-column type="index" :label="$t('sernum')">
                </el-table-column>
                <el-table-column prop="accRecordId" :label="$t('record')" width="148">
                </el-table-column>
                <el-table-column prop="accType" :label="$t('acctype')" width="160">
                </el-table-column>
                <el-table-column prop="initialAmt" :label="$t('initialbalance')" width="107">
                </el-table-column>
                <el-table-column prop="finalAmt" :label="$t('endingbalance')" width="115">
                </el-table-column>
                <el-table-column prop="dayInAmt" :label="$t('totalrevenuem')" width="104">
                </el-table-column>
                <el-table-column prop="dayInCount" :label="$t('totalrevenue')" width="108">
                </el-table-column>
                <el-table-column prop="dayOutAmt" :label="$t('totalamoisbur')" width="165">
                </el-table-column>
                <el-table-column prop="dayOutCount" :label="$t('totalexpenditure')" width="134">
                </el-table-column>
                <el-table-column prop="billingDate" :label="$t('accountingtime')" width="150">
                </el-table-column>
            </el-table>
        </el-card>
    </div>
</template>

<script>
import {
    getbilldayacclist
} from '@/libs/reqlist.js'
export default {
    data () {
        return {
            id: 0,
            accBillTab: []
        }
    },
    methods: {
        getAccBillList() {
            getbilldayacclist(this.id).then(res => {
                if (res.data.code === '000000') {
                    for (let i = 0; i < res.data.data.length; i++) {
                        let key = res.data.data[i]
                        if (key.accType === 'CLEARING') key.accType = this.$t('clearacc')
                        if (key.accType === 'SETTLE') key.accType = this.$t('setacc')
                        if (key.accType === 'RECHARGE') key.accType = this.$t('rechargeacc')
                        if (key.accType === 'FROZEN') key.accType = this.$t('frozenacc')
                        if (key.accType === 'SHARE_PROFIT') key.accType = this.$t('dividendsacc')
                        if (key.accType === 'LOCKED') key.accType = this.$t('lockacc')
                        if (key.accType === 'REFUND_LOCKED') key.accType = this.$t('refundlockaccount')
                        if (key.accType === 'SETTLE_LOCKED') key.accType = this.$t('settlementlockaccount')
                        if (key.accType === 'FEE_IN') key.accType = this.$t('commissionacc')
                    }
                    this.accBillTab = res.data.data
                }
            })
        }
    },
    mounted () {
        this.id = window.sessionStorage.getItem('billRecordId')
        this.getAccBillList()
    },
    destroyed () {
        window.sessionStorage.removeItem('billRecordId')
    }
}
</script>

<style lang="less" scoped>
@import './accquery.less';
</style>
